Repository navigation
Conversation
Each .github/agents pointer carried a hand-copied copy of its agent's frontmatter. Generate the pointers with scripts/sync-agents.mjs instead, and fail CI when they are out of date. The shared definitions in .agents/agents now keep tool-neutral fields (name, description) at the top level and the Copilot tools, agents and handoffs in a copilot block. The generated Copilot frontmatter is unchanged. The generator can also write Claude Code subagents from a claude block. No agent uses it, because VS Code Copilot also loads .claude/agents and would list every agent twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Dec 4, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
An active moderate issue remains because the sync script can overwrite hand-written agent files at expected output paths, risking silent data loss.
1 open issue
What changed in this PR
Adds generation of Copilot agent pointers from shared agent definitions, with synchronization tests, CI drift checks, and updated documentation.
Changes:
- Added the synchronization generator and tests.
- Migrated agent definitions to tool-specific blocks.
- Regenerated pointers and documented the workflow.
| File | Description |
|---|---|
| scripts/sync-agents.spec.mjs | Adds tests for agent parsing, rendering, synchronization, and orphan removal. |
| scripts/sync-agents.mjs | Implements generation and validation of tool-specific agent pointer files. |
| AGENTS.md | Documents the shared agent definition and pointer generation workflow. |
| .github/workflows/nodejs.yml | Runs generator tests and checks generated pointers for drift in CI. |
| .github/agents/theming-styles-agent.md | Updates the generated Copilot pointer for the theming styles agent. |
| .github/agents/tdd-test-writer-agent.md | Updates the generated Copilot pointer for the TDD test writer agent. |
| .github/agents/migration-agent.md | Updates the generated Copilot pointer for the migration agent. |
| .github/agents/feature-orchestrator-agent.md | Updates the generated Copilot pointer for the feature orchestrator agent. |
| .github/agents/feature-implementer-agent.md | Updates the generated Copilot pointer for the feature implementer agent. |
| .github/agents/demo-sample-agent.md | Updates the generated Copilot pointer for the demo sample agent. |
| .github/agents/component-readme-agent.md | Updates the generated Copilot pointer for the component README agent. |
| .github/agents/changelog-agent.md | Updates the generated Copilot pointer for the changelog agent. |
| .github/agents/bug-fixing-orchestrator-agent.md | Updates the generated Copilot pointer for the bug-fixing orchestrator agent. |
| .github/agents/bug-fixing-implementer-agent.md | Updates the generated Copilot pointer for the bug-fixing implementer agent. |
| .agents/README.md | Documents shared agent definitions, generated outputs, and synchronization commands. |
| .agents/agents/theming-styles-agent.md | Moves Copilot configuration into the shared theming styles agent definition. |
| .agents/agents/tdd-test-writer-agent.md | Moves Copilot configuration into the shared TDD test writer agent definition. |
| .agents/agents/migration-agent.md | Moves Copilot configuration into the shared migration agent definition. |
| .agents/agents/feature-orchestrator-agent.md | Moves Copilot configuration into the shared feature orchestrator agent definition. |
| .agents/agents/feature-implementer-agent.md | Moves Copilot configuration into the shared feature implementer agent definition. |
| .agents/agents/demo-sample-agent.md | Moves Copilot configuration into the shared demo sample agent definition. |
| .agents/agents/component-readme-agent.md | Moves Copilot configuration into the shared component README agent definition. |
| .agents/agents/changelog-agent.md | Moves Copilot configuration into the shared changelog agent definition. |
| .agents/agents/bug-fixing-orchestrator-agent.md | Moves Copilot configuration into the shared bug-fixing orchestrator agent definition. |
| .agents/agents/bug-fixing-implementer-agent.md | Moves Copilot configuration into the shared bug-fixing implementer agent definition. |
Review effort: Lite
Comment on lines
+209
to
+211
| const write = [...outputs] | ||
| .filter(([file, text]) => !existing.has(file) || normalize(existing.get(file)) !== text) | ||
| .map(([file]) => file); |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stack 2/3. Based on #18092. Review that one first; this PR's diff only shows its own changes.
Description
Generates the Copilot pointer files in
.github/agents/from the shared agent definitions with a new script,scripts/sync-agents.mjs, and fails CI when they drift..agents/agents/*.mdkeeps tool-neutral fields (name,description) at the top level, and the Copilottools,agentsandhandoffsin acopilot:block.node scripts/sync-agents.mjswrites the pointers, and--checkexits 1 when one is missing or out of date. It removes generated files whose source was deleted, and leaves hand-written files alone.build-lintjob innodejs.ymlruns the generator's spec and--check.AGENTS.mdand.agents/README.mdsay to edit only the source file and re-run the script.The generated Copilot frontmatter is byte-identical to before. Only the HTML comment in each pointer changed.
Motivation / Context
Each pointer used to carry a hand-copied copy of its agent's frontmatter ("copy its frontmatter here unchanged"), and those copies would drift over time.
Copilot only discovers custom agents in
.github/agents/(VS Code also reads.claude/agents/), not in.agents/agents/. Adding.agents/agentsthroughchat.agentFilesLocationsis not recommended, because Copilot CLI and the Copilot app ignore editor location settings. So the pointer files stay, and they are now generated.The generator also supports a
claude:block that writes Claude Code subagents to.claude/agents/. No agent uses it yet: VS Code Copilot also loads.claude/agents/, so every agent would show up twice in its picker.Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Agent infrastructure (
.agents/agents,.github/agents),scripts/,nodejs.ymlHow Has This Been Tested?
node --test scripts/sync-agents.spec.mjs, 10 tests passing (parsing, CRLF input, invalid frontmatter, rendering, orphan removal)--checkpassesactionlintpasses onnodejs.yml; ESLint passes on the new scripts;npm run lint:libpasses (0 errors)🤖 Generated with Claude Code